package com.zqj.project.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @Description: OrderDetailDTO
 * @Author: 22001010704 Zhang Qijian
 * @CreateTime: 2024/12/8 18:32
 * @Version: 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
public class OrderDetailDTO implements Serializable {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @NotNull(message = "订单ID不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orderId;

    @NotNull(message = "商品ID不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long productId;

    private String productName;

    @NotNull(message = "商品数量不能为空")
    private Integer number;

    private BigDecimal price;

    private BigDecimal totalPrice;

}